package org.finesys.system.api.feign;

import org.finesys.common.constants.ServerConstants;
import org.finesys.common.core.module.R;
import org.finesys.system.api.entity.SysDictItem;
import org.finesys.system.api.service.DictService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(contextId = "dictServiceApi", value = ServerConstants.SYSTEM_SERVER)
public interface DictServiceApi extends DictService {

    /**
     * 通过字典类型查找字典
     *
     * @param type 字典类型
     * @return 同类型字典
     */
    @GetMapping("/dict/type/{type}")
    R<List<SysDictItem>> getDictByType(@PathVariable("type") String type);

}
